#!/usr/bin/env php
<?php
ini_set('display_errors', 'on');
use Workerman\Worker;

// 检查扩展
if(!extension_loaded('pcntl'))
{
    exit("Please install pcntl extension. See http://doc3.workerman.net/install/install.html\n");
}

if(!extension_loaded('posix'))
{
    exit("Please install posix extension. See http://doc3.workerman.net/install/install.html\n");
}

// 标记是全局启动
define('GLOBAL_START', 1);

require __DIR__ . '/vendor/autoload.php';

// 消费
$worker = new \WorkermanThrift\ThriftWorker('tcp://0.0.0.0:9191');
$worker->count = 10;
$worker->processor_class = \Services\RocketMqConsumer\RocketMqConsumerProcessor::class;
$worker->handler_class = \services\thriftHandle\RocketMqConsumerHandler::class; //处理消息
$worker->name = 'RocketMqConsumer1'; //进程名

Worker::runAll();
